Add Support for Custom HTTP Headers in agent-python via Argument - #55
Add Support for Custom HTTP Headers in agent-python via Argument#55BrunoTeixeira1996 wants to merge 8 commits into
Conversation
|
Thanks for creating this PR, I'll create a review now with some smaller adjustments needed. |
s3inlc
left a comment
There was a problem hiding this comment.
Can you update the README.md with the output of the --help command to also include the --http-headers flag. Also maybe state in the help text of the flag, how this needs to look like in format.
There was a problem hiding this comment.
There seems to be an issue with these changes. The count does not count since the last tag but probably from the beginning. When I build on this branch, I get s3-python-0.7.3.781 as version (whereas the count should be something around 5-10 since 0.7.3).
… root git describe would fail whenever tags aren't available locally (e.g. a fork with no tags), and the old fallback counted commits since the very first commit instead of since the last release tag, producing bogus version suffixes like 0.7.3.781. Now it fetches tags best-effort and falls back to count=0 (no suffix) if no tag can be found.
7790bcc to
26d399f
Compare
|
@s3inlc I think everything its working as you wanted? Can you please confirm this? |
Hi guys,
I was using Hashtopolis inside a Docker container inside a VPS, however I wanted to integrated vast.ai to act as my agents and so for that I had to expose the VPS to the internet. That's not good in my opinion as we could get a lot of traffic from people trying to bruteforce the login form.
Knowing this I implemented a Cloud Flare Tunnel exposing port 8080 localy and assigned to a domain of my own - adding to this I also created an access rule that only people with a certain CF header can access that login form, thus making this login form protected.
Everything worked just fine however the agent-python was not prepared to deal with this kind of authentication since the requests being made dont use any kind of authentication mechanism and there's no argumment available to do this right now.
This pull request adds a new flag called
http-headersthat is optional but if used these headers will be used on the Session.py and jsonRequest.py thus making it possible to authenticate in the CF Tunnel and make requests to the Hashtopolis Server.I tested all of this using vast.ai agents and everything worked just fine!
Please tell me if you guys need anything to be changed as I am willing to help
Thanks!